#
# @lc app=leetcode.cn id=383 lang=python3
#
# [383] 赎金信
#
from typing import Counter
# @lc code=start
class Solution:
    def canConstruct(self, ransomNote: str, magazine: str) -> bool:
        d = Counter(magazine)
        for ch in ransomNote:
            if d[ch] == None or d[ch] == 0:
                return False
            d[ch] = d[ch] - 1
        return True
# @lc code=end

